package com.movie.ticket.sale.movieinterface.cinema;


import com.movie.ticket.sale.movieinterface.common.Result;
import com.movie.ticket.sale.movieinterface.model.TAuditorium;
import com.movie.ticket.sale.movieinterface.model.TCinema;
import com.movie.ticket.sale.movieinterface.model.TPerid;
import com.movie.ticket.sale.movieinterface.model.TVip;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;



@RestController
@Api(tags = "影院客户端相关接口，默认是登录状态，拥有影院的ID", description = "提供影院相关操作的API")
public class Cinema {

//========================================影院的可视化数据======================================================
    @ApiOperation("根据影院的ID查看影院的收入数据")
    @ApiImplicitParams({@ApiImplicitParam(name = "cinemaId",value = "影院id")})
    @GetMapping("movie/cinema/data/acount")
    public Result cinemaAcount(int cinemaId){
        return Result.success("{电影名：票房,电影名：票房}");
    }

//=======================================影院的申请进度============================================================
    @ApiOperation("根据影院的ID查看影院的审核状态")
    @ApiImplicitParams({@ApiImplicitParam(name = "cinemaId",value = "影院id")})
    @GetMapping("movie/cinema/state")
    public Result showState(int cinemaId){
        return Result.success("0:申请中 1:人工核查中 2:正常运作 -1:停运");
    };

//=====================================影院的影院管理==============================================
    @ApiOperation("查询平台影片库信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "",value = "")})
    @GetMapping("movie/cinema/myMovie/allMovie")
    public Result findAllMovies(){
        return Result.success("返回值应该为一个电影信息的集合");
    }

    @ApiOperation("选择一部影片关联到影院的库里面")
    @ApiImplicitParams({@ApiImplicitParam(name = "movieId",value = "影片的id")})
    @PostMapping("movie/cinema/myMovie/pullMovie")
    public Result pullMovie(int movieId){
        return Result.success("关联成功");
    }

    @ApiOperation("查询影院拉取的电影信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "",value = "")})
    @GetMapping("movie/cinema/myMovie/findCinemaMovie")
    public Result findCinemaMovie(){
        return Result.success("返回一个电影信息的集合");
    }

    @ApiOperation("将与影院关联的电影进行下架，就不可再排片,修改状态操作")
    @ApiImplicitParams({@ApiImplicitParam(name = "CinemaId",value = "影院影片关联表ID")})
    @PutMapping("movie/cinema/myMovie/soldOutCinemaMovie")
    public Result soldOutCinemaMovie(int CinemaId){
        return Result.success("将关联表中的状态改为下架");
    }

    @ApiOperation("将与影院下架的电影进行上架，就可以排片,修改状态操作")
    @ApiImplicitParams({@ApiImplicitParam(name = "CinemaId",value = "影院影片关联表ID")})
    @PutMapping("movie/cinema/myMovie/putawayCinemaMovie")
    public Result putawayCinemaMovie(int CinemaId){
        return Result.success("上架成功");
    }

//    ==================================影院影厅管理=========================================

    @ApiOperation("查询影院的影厅信息查询操作")
    @ApiImplicitParams({@ApiImplicitParam(name = "",value = "")})
    @GetMapping("movie/cinema/auditorium/findAuditorium")
    public Result findAuditorium(){
        return Result.success("返回一个影厅信息的集合");
    }

    @ApiOperation("新增影院的影厅,新增操作")
    @ApiImplicitParams({@ApiImplicitParam(name = "tAuditorium",value = "此参数包含了影厅的名称，座位，座位数量，类型的信息")})
    @PostMapping("movie/cinema/auditorium/addAuditorium")
    public Result addAuditorium(@ModelAttribute TAuditorium tAuditorium){
        return Result.success("影厅增加成功");
    }

    @ApiOperation("对影院的影厅信息进行修改操作")
    @ApiImplicitParams({@ApiImplicitParam(name = "tAuditorium",value = "此参数包含了需要修改的影厅的ID，名称，座位，座位数量，类型的信息")})
    @PutMapping("movie/cinema/auditorium/updateAuditorium")
    public Result updateAuditorium(@ModelAttribute TAuditorium tAuditorium){
        return Result.success("修改成功");
    }

    @ApiOperation("对影院的影厅进行停用")
    @ApiImplicitParams({@ApiImplicitParam(name = "auditoriumId",value = "影厅的ID")})
    @PutMapping("movie/cinema/auditorium/soldOutAuditorium")
    public Result soldOutAuditorium(int auditoriumId){
        return Result.success("停用成功");
    }

    @ApiOperation("对影院的影厅进行启用")
    @ApiImplicitParams({@ApiImplicitParam(name = "auditoriumId",value = "影厅的ID")})
    @PutMapping("movie/cinema/auditorium/putawayAuditorium")
    public Result putawayAuditorium(int auditoriumId){
        return Result.success("启用成功");
    }


//   ==================================子影院管理============================================================

    @ApiOperation("添加子影院")
    @ApiImplicitParams({@ApiImplicitParam(name = "tCinema",value = "包含子影院的名字，地址，法人，营业执照等信息")})
    @PostMapping("movie/cinema/childCinema/addChildCinema")
    public Result addChildCinema(@ModelAttribute TCinema tCinema){
        return Result.success("添加成功");
    }

    @ApiOperation("查询子影院")
    @ApiImplicitParams({@ApiImplicitParam(name = "",value = "")})
    @GetMapping("movie/cinema/childCinema/findChildCinema")
    public Result findChildCinema(){
        return Result.success("返回一个子影院信息的集合");
    }

    @ApiOperation("将子影院停运")
    @ApiImplicitParams({@ApiImplicitParam(name = "ChildCinemaId",value = "子影院id")})
    @PutMapping("movie/cinema/childCinema/soldOutChildCinema")
    public Result soldOutChildCinema(int ChildCinemaId){
        return Result.success("已停运");
    }

    @ApiOperation("将停运的子影院恢复正常")
    @ApiImplicitParams({@ApiImplicitParam(name = "ChildCinemaId",value = "子影院id")})
    @PutMapping("movie/cinema/childCinema/putawayChildCinema")
    public Result putawayChildCinema(int ChildCinemaId){
        return Result.success("已恢复");
    }


//    ====================================会员管理====================================================

    @ApiOperation("新增影城会员服务规则")
    @ApiImplicitParams({@ApiImplicitParam(name = "vip",value = "影院的vip规则，是包含会员资费，折扣率等信息的表单")})
    @PostMapping("movie/cinema/vip/addvip")
    public Result addvip(@ModelAttribute TVip vip){
        return Result.success("设置成功");
    }

    @ApiOperation("下架影城会员服务")
    @ApiImplicitParams({@ApiImplicitParam(name = "vipId",value = "影院的vip规则表的id，以此来修改状态")})
    @PutMapping("movie/cinema/vip/closevip")
    public Result closevip(int vipId){
        return Result.success("关闭成功");
    }

    @ApiOperation("将下架的会员规则重新上架")
    @ApiImplicitParams({@ApiImplicitParam(name = "vipId",value = "影院的vip规则表的id，以此来修改状态")})
    @PostMapping("movie/cinema/vip/openvip")
    public Result openvip(int vipId){
        return Result.success("上架成功");
    }

    @ApiOperation("将会员规则删除")
    @ApiImplicitParams({@ApiImplicitParam(name = "vipId",value = "影院的vip规则表的id，以此来删除")})
    @DeleteMapping("movie/cinema/vip/delvip")
    public Result delvip(int vipId){
        return Result.success("删除成功");
    }

//    ======================================排片========================================================

    @ApiOperation("查询排片信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "",value = "")})
    @GetMapping("movie/cinema/plan/findPlan")
    public Result findPlan(){
        return Result.success("返回一个排片信息的集合");
    }

    @ApiOperation("进行排片，也就是增加场次表")
    @ApiImplicitParams({@ApiImplicitParam(name = "perid",value = "前端传回来的场次信息，新增，不包含id")})
    @PostMapping("movie/cinema/plan/addPlan")
    public Result addPlan(@ModelAttribute TPerid perid){
        return Result.success("排片成功");
    }

    @ApiOperation("修改排片信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "perid",value = "前端传回来的场次信息，修改，包含id")})
    @PutMapping("movie/cinema/plan/updatePlan")
    public Result updatePlan(@ModelAttribute TPerid perid){
        return Result.success("修改成功");
    }

    @ApiOperation("删除排片信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "id",value = "前端传回来的场次信息的id，根据这个id删除排片信息")})
    @DeleteMapping("movie/cinema/plan/delPlan")
    public Result delPlan(int id){
        return Result.success("删除成功");
    }

//   ==================================查询订单======================================================================

//    @ApiOperation("查询当前影院的订单信息,会涉及")
//    @ApiImplicitParams({@ApiImplicitParam(name = "",value = "前端传回来的场次信息的id，根据这个id删除排片信息")})
//    @DeleteMapping("movie/cinema/order/findOrder")
//    public Result findOrder(){
//
//    }





}
